using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableTreasureStrengthenDao:DaoBase<TableTreasureStrengthen>
    {
        public override void AddPrimaryIndex(TableTreasureStrengthen model)
        {
            cachePrimary[model.treasureId.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableTreasureStrengthen.txt";
        }

        protected override TableTreasureStrengthen ParseRowData(string[] rowData)
        {
            TableTreasureStrengthen data = new TableTreasureStrengthen();
			data.treasureId = rowData [0];

            if (string.IsNullOrEmpty(rowData[1]))
            {
                data.attGrow = 0;
            }
            else
            {
                data.attGrow = int.Parse(rowData[1]);
            }

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.hpGrow = 0;
            }
            else
            {
                data.hpGrow = int.Parse(rowData[2]);
            }

            if (string.IsNullOrEmpty(rowData[3]))
            {
                data.criGrow = 0;
            }
            else
            {
                data.criGrow = double.Parse(rowData[3]);
            }

            if (string.IsNullOrEmpty(rowData[4]))
            {
                data.anticriGrow = 0;
            }
            else
            {
                data.anticriGrow = double.Parse(rowData[4]);
            }

            if (string.IsNullOrEmpty(rowData[5]))
            {
                data.perhitGrow = 0;
            }
            else
            {
                data.perhitGrow = double.Parse(rowData[5]);
            }

            if (string.IsNullOrEmpty(rowData[6]))
            {
                data.perevadeGrow = 0;
            }
            else
            {
                data.perevadeGrow = double.Parse(rowData[6]);
            }

            return data;
        }



    }

}
